package org.spring.springcar.controller;

import org.spring.springcar.configuration.DbTypeConfig;
import org.spring.springcar.configuration.Student;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

@RestController
@RequestMapping("/yaml")
public class YamlController {

    @Value("${yaml}")
    private String yaml;

    @Value("${spring.datasource.username}")
    private String username;

    @Value("${string.str1}")
    private String str1;

    @Value("${string.str2}")
    private String str2;

    @Value("${string.str3}")
    private String str3;

    @Autowired
    private Student student;

    @Autowired
    private DbTypeConfig dbTypeConfig;

    @RequestMapping("/read")
    public String read(){
        System.out.println(yaml);
        System.out.println(username);
        System.out.println(str1);
        System.out.println(str2);
        System.out.println(str3);

        System.out.println(student);
        System.out.println(dbTypeConfig);
        return "success";
    }
}
